package com.mixsmart.core.xml.sqlmap;

import java.util.Map;
import java.util.Set;

import com.mixsmart.core.helper.SqlUnitHelper;
import com.mixsmart.core.parser.IParser;
import com.mixsmart.core.xml.sqlmap.SqlMapParser;
import com.mixsmart.core.xml.sqlmap.bean.SQLMapFile;
import com.mixsmart.core.xml.sqlmap.bean.SqlUnit;

/**
 * 测试类
 * @author lmq
 * @version 1.0
 * @since JDK版本大于等于1.6
 * 2016年1月21日
 */
public class SqlMapParserTestMain {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		IParser parser = new SqlMapParser("cn/com/mixsmart/resources/base.sql.xml");
		SQLMapFile sqlMapFile = parser.parser();
		if(null != sqlMapFile) {
			Map<String, SqlUnit> maps = sqlMapFile.getSqlMaps();
			if(null != maps) {
				Set<String> keys = maps.keySet();
				if(null != keys && keys.size()>0) {
					for (String key : keys) {
						System.out.println(key+" = "+SqlUnitHelper.toStr(maps.get(key)));
					}
				}
			}
		}
	}

}
